#pragma once 

//封装⼀条完整的⽇志消息所需的内容
#include "util.hpp"
#include "level.hpp"
#include <iostream>
#include <thread>

namespace wu {
    class LogMsg {
    public:
          LogMsg(LogLevel::value level, const size_t line, const std::string file, const std::string logger, const std::string payload)
          :_ctime(util::Data::getTime())
          ,_level(level)
          ,_line(line)
          ,_file(file)
          ,_logger(logger)
          ,_tid(std::this_thread::get_id())
          ,_payload(payload)
          {}

    time_t _ctime;//日志产生的时间(时间戳)
    LogLevel::value _level;//日志等级
    size_t _line;//行号
    std::string _file;//源文件名
    std::string _logger;//日志器名
    std::thread::id _tid;//调用的线程id
    std::string _payload;//有效消息数据-有效载荷
    };
}
